Skip to content

feat(UI): add label apis#1144

Merged
genedna merged 2 commits into
gitmono-dev:mainfrom
benjamin-747:main
Jun 20, 2025
Merged

feat(UI): add label apis#1144
genedna merged 2 commits into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@benjamin-747
benjamin-747 requested a review from genedna June 20, 2025 09:15
@benjamin-747 benjamin-747 self-assigned this Jun 20, 2025
@benjamin-747 benjamin-747 added rust Pull requests that update Rust code ui labels Jun 20, 2025
@vercel

vercel Bot commented Jun 20, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 1:59pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds first-class support for labels across the stack—database, backend API, generated TypeScript types, and UI—replacing the old owner field with user_id.

  • Introduces new label and item_labels tables via a SeaORM migration and extends the conv_type_enum.
  • Extends Axum routers, handlers, and storage to create, list, and update labels on issues and merge requests.
  • Updates generated TypeScript definitions (LabelItem, payloads, API methods) and adapts React components to use user_id and display labels.

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
third-party/Cargo.toml Bump tokio-tungstenite/tungstenite to 0.27 for new API needs
moon/packages/types/generated.ts Add LabelItem, label-related payloads and methods
moon/apps/web/components/Issues/IssuesContent.tsx Switch from owner to user_id
moon/apps/web/components/Issues/IssuePage.tsx Switch from owner to user_id
mono/src/server/https_server.rs Allow PUT in CORS and register LABEL_TAG
mono/src/api/user/user_router.rs Simplify SSH key/token handlers with ?
mono/src/api/oauth/mod.rs Replace unwrap() with error logging and ?
mono/src/api/oauth/campsite_store.rs Simplify JSON deserialization error handling
mono/src/api/mr/mr_router.rs Refactor MR handlers; add /api/v1/mr/labels route
mono/src/api/label/mod.rs Define LabelItem & NewLabel models
mono/src/api/label/label_router.rs Add /label/new and /label/list Axum routes
mono/src/api/issue/mod.rs Extend IssueItem, IssueDetail, and add label payload
mono/src/api/issue/issue_router.rs Add /issue/labels route and shared label logic
mono/src/api/error.rs Return JSON CommonResult on errors
mono/src/api/api_router.rs Merge in label_router
jupiter/migration/src/m20250618_065050_add_label.rs Create label/item_labels tables and drop old owner column
jupiter/src/storage/issue_storage.rs Extend storage with label CRUD & conversation logging
jupiter/src/storage/mr_storage.rs Remove legacy MR conversation methods
jupiter/callisto/src/sea_orm_active_enums.rs Add Label variant to ConvTypeEnum
jupiter/callisto/src/mega_issue.rs Remove owner, add user_id
jupiter/callisto/src/label.rs Generate SeaORM entity for label
jupiter/callisto/src/item_labels.rs Generate SeaORM entity for item_labels
config/config.toml Update campsite_api_domain and allowed CORS origins
common/src/model.rs Add common_failed() helper
common/src/errors.rs Derive thiserror::Error on MegaError
ceres/src/protocol/mod.rs Remove deprecated mr protocol
ceres/src/pack/monorepo.rs Switch to mega_mr::Model and propagate MegaError
ceres/src/api_service/mono_api_service.rs Switch merge/MR API to use mega_mr::Model
Comments suppressed due to low confidence (1)

common/src/errors.rs:13

  • The Error derive macro is used but not imported; add use thiserror::Error; at the top to avoid a compile error.
#[derive(Error, Debug)]

Comment on lines +81 to +82
.await
.unwrap();

Copilot AI Jun 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using .unwrap() here can panic the server if adding a conversation fails; replace with ? to propagate the error instead of unwrapping.

Copilot uses AI. Check for mistakes.
let old_labels = issue_storage
.find_item_exist_labels(payload.item_id)
.await
.unwrap();

Copilot AI Jun 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling .unwrap() on the result of find_item_exist_labels may cause a panic; use ? to return an error if label‐lookup fails.

Suggested change
.unwrap();
?;

Copilot uses AI. Check for mistakes.
@genedna
genedna enabled auto-merge June 20, 2025 14:35
@genedna
genedna added this pull request to the merge queue Jun 20, 2025
Merged via the queue into gitmono-dev:main with commit f2e33aa Jun 20, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants